<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js" th:src="@{/lib/html5shiv.js}"></script>
<script type="text/javascript" src="lib/respond.min.js" th:src="@{/lib/respond.min.js}"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="h-ui/css/H-ui.min.css" th:href="@{/h-ui/css/H-ui.min.css}" />
<link rel="stylesheet" type="text/css" href="h-ui.admin/css/H-ui.admin.css" th:href="@{/h-ui.admin/css/H-ui.admin.css}"/>
<link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css" th:href="@{/lib/Hui-iconfont/1.0.8/iconfont.css}"/>
<link rel="stylesheet" type="text/css" href="h-ui.admin/skin/default/skin.css" th:href="@{/h-ui.admin/skin/default/skin.css}" id="skin" />
<link rel="stylesheet" type="text/css" href="h-ui.admin/css/style.css" th:href="@{/h-ui.admin/css/style.css}" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" th:src="@{/lib/DD_belatedPNG_0.0.8a-min.js}"></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<!--/meta 作为公共模版分离出去-->

<title>新增信息 - 信息管理 - 富源英美 v1.0</title>
</head>
<body>
<article class="page-container">
	<form class="form form-horizontal" id="form-article-add" action="updateInfoManage" method="post">
		<input type="hidden" id="id" name="id" th:value="${id}"/>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>来电日期时间：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text"  readonly="readonly" id="callTime" name="callTime" class="input-text form_datetime"/>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">预约时间：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text"  readonly="readonly" id="appointment" name="appointment" class="input-text form_datetime"/>
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>学生姓名：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="studentName" name="studentName"/>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">信息状态

				<span class="dropDown">
			<a class="dropDown_A c-red" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">(点击选择):</a>
						<ul class="dropDown-menu menu radius box-shadow">
				<li class=""><a href="javascript:setStateName('未访校',1)">未访校<i class="arrow Hui-iconfont"></i></a>
					<ul class="menu">
						<li class=""><a href="javascript:setStateName('未访校,国际意向',3);">国际意向<i class="arrow Hui-iconfont"></i></a>
							<ul class="menu">
								<li class=""><a href="javascript:setStateName('未访校,国际意向,访校犹豫',9);">访校犹豫<i class="arrow Hui-iconfont"></i></a>
									<ul class="menu">
										<li class=""><a href="javascript:setStateName('未访校,国际意向,访校犹豫,弱',23);">弱</a></li>
										<li class=""><a href="javascript:setStateName('未访校,国际意向,访校犹豫,中',24);">中</a></li>
										<li class=""><a href="javascript:setStateName('未访校,国际意向,访校犹豫,强',25);">强</a></li>
									</ul>
								</li>
								<li class=""><a href="javascript:setStateName('已访校,预约访校',10);">预约访校</a></li>
								<li class=""><a href="javascript:setStateName('已访校,预约考试',11);">预约考试</a></li>
							</ul>
						</li>
						<li class=""><a href="javascript:setStateName('未访校,国内意向',4);">国内意向<i class="arrow Hui-iconfont"></i></a>
							<ul class="menu">
								<li class=""><a href="javascript:setStateName('未访校,国内意向,无意向',12);">无意向</a></li>
								<li class=""><a href="javascript:setStateName('未访校,国内意向,富源意向',13);">富源意向</a></li>
							</ul>
						</li>
						<li class=""><a href="javascript:setStateName('未访校,暂无意向',5);">暂无意向<i class="arrow Hui-iconfont"></i></a>
							<ul class="menu">
								<li class=""><a href="javascript:setStateName('未访校,暂无意向,无意向',14);">无意向</a></li>
								<li class=""><a href="javascript:setStateName('未访校,暂无意向,延时意向',15);">延时意向</a></li>
							</ul>
						</li>
					</ul>
				</li>
				<li class=""><a href="javascript:setStateName('已访校',2);">已访校<i class="arrow Hui-iconfont"></i></a>
					<ul class="menu">
						<li class=""><a href="javascript:setStateName('已访校,国际意向',6);">国际意向<i class="arrow Hui-iconfont"></i></a>
							<ul class="menu">
								<li class=""><a href="javascript:setStateName('已访校,国际意向,预约访校',16);">预约访校<i class="arrow Hui-iconfont"></i></a>
									<ul class="menu">
										<li class=""><a href="javascript:setStateName('已访校,国际意向,预约访校,弱',26);">弱</a></li>
										<li class=""><a href="javascript:setStateName('已访校,国际意向,预约访校,中',27);">中</a></li>
										<li class=""><a href="javascript:setStateName('已访校,国际意向,预约访校,强',28);">强</a></li>
									</ul>
								</li>
								<li class=""><a href="javascript:setStateName('已访校,国际意向,参加考试',17);">参加考试<i class="arrow Hui-iconfont"></i></a>
									<ul class="menu">
										<li class=""><a href="javascript:setStateName('已访校,国际意向,参加考试,未录取',29);">未录取</a></li>
										<li class=""><a href="javascript:setStateName('已访校,国际意向,参加考试,录取',30);">录取<i class="arrow Hui-iconfont"></i></a>
											<ul class="menu">
												<li class=""><a href="javascript:setStateName('已访校,国际意向,参加考试,录取,弱',32);">弱</a></li>
												<li class=""><a href="javascript:;setStateName('已访校,国际意向,参加考试,录取,弱',33)">中</a></li>
												<li class=""><a href="javascript:;setStateName('已访校,国际意向,参加考试,录取,弱',34)">强</a></li>
											</ul>
										</li>
									</ul>
								</li>
								<li class=""><a href="javascript:setStateName('已访校,国际意向,面试'),18;">面试<i class="arrow Hui-iconfont"></i></a>
									<ul class="menu">
										<li class=""><a href="javascript:setStateName('已访校,国际意向,面试,缴费',31);">缴费<i class="arrow Hui-iconfont"></i></a>
											<ul class="menu">
												<li class=""><a href="javascript:setStateName('已访校,国际意向,面试,缴费,订金',36);">订金</a></li>
												<li class=""><a href="javascript:setStateName('已访校,国际意向,面试,缴费,全额',37);">全额</a></li>
											</ul>
										</li>
									</ul>
								</li>
							</ul>
						</li>
						<li class=""><a href="javascript:setStateName('已访校,国内意向',7);">国内意向<i class="arrow Hui-iconfont"></i></a>
							<ul class="menu">
								<li class=""><a href="javascript:setStateName('已访校,国内意向,无意向',19);">无意向</a></li>
								<li class=""><a href="javascript:setStateName('已访校,国内意向,富源意向',20);">富源意向</a></li>
							</ul>
						</li>
						<li class=""><a href="javascript:setStateName('已访校,暂无意向',8)">暂无意向<i class="arrow Hui-iconfont"></i></a>
							<ul class="menu">
								<li class=""><a href="javascript:setStateName('已访校,暂无意向,无意向',21);">无意向</a></li>
								<li class=""><a href="javascript:setStateName('已访校,暂无意向,延时意向',22);">延时意向</a></li>
							</ul>
						</li>
					</ul>
				</li>
			</ul>
			</span>
			</label>

			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="stateName" name="stateName" readonly="readonly"/>
				<input type="hidden" class="input-text" value=""  id="infoState" name="infoState" />
			</div>

		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">考虑入学时间：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<select  id="considerAdmissionTime" name="considerAdmissionTime" class="select">

				</select>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>咨询内容：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<textarea id="consultationContent" name="consultationContent" cols="" rows="" class="textarea"  placeholder="说点什么...最少输入10个字符" datatype="*10-100" dragonfly="true" nullmsg="备注不能为空！" ></textarea>
				<p class="textarea-numberbar"><em class="textarea-length">0</em>/200</p>
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">联系电话1：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="contactNumMain" name="contactNumMain"/>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">家长姓名1：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="parentNameMain" name="parentNameMain"/>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">联系电话2：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="contactNumOther" name="contactNumOther"/>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">家长姓名2：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="parentNameOther" name="parentNameOther"/>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">现读学校：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="currentSchool" name="currentSchool"/>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">现读年级：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="currentGrade" name="currentGrade"/>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">家庭住址：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="homeAddress" name="homeAddress"/>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>信息来源：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="infoSource" name="infoSource"/>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">特别备注：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="remark" name="remark">
			</div>
		</div>

		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">数学：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="mathScore" name="mathScore">
			</div>
		</div>
		<!--<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">数学等级：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="mathGrade" name="mathGrade">
			</div>
		</div>-->
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">英语：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="englishScore" name="englishScore">
			</div>
		</div>
		<!--<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">英语等级：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="englishGrade" name="englishGrade">
			</div>
		</div>-->
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">物化：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="phyChemScore" name="phyChemScore">
			</div>
		</div>
		<!--<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">物化等级：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="" placeholder="" id="phyChemGrade" name="phyChemGrade">
			</div>
		</div>-->

		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<!--<button onClick="article_save_submit();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存并提交审核</button>-->
				<button id="infoManageSave" class="btn btn-secondary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
				<!--<button onClick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>-->
			</div>
		</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"  th:src="@{/lib/jquery/1.9.1/jquery.min.js}"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js" th:src="@{/lib/layer/2.4/layer.js}"></script>
<script type="text/javascript" src="h-ui/js/H-ui.min.js" th:src="@{/h-ui/js/H-ui.min.js}"></script>
<script type="text/javascript" src="h-ui.admin/js/H-ui.admin.js" th:src="@{/h-ui.admin/js/H-ui.admin.js}"></script> <!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js" th:src="@{/lib/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js}"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/jquery.validate.js" th:src="@{/lib/jquery.validation/1.14.0/jquery.validate.js}"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/validate-methods.js" th:src="@{/lib/jquery.validation/1.14.0/validate-methods.js}"></script>
<script type="text/javascript" src="lib/jquery.validation/1.14.0/messages_zh.js" th:src="@{/lib/jquery.validation/1.14.0/messages_zh.js}"></script>
<script type="text/javascript" src="lib/webuploader/0.1.5/webuploader.min.js" th:src="@{/lib/webuploader/0.1.5/webuploader.min.js}"></script>
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.config.js"  th:src="@{/lib/ueditor/1.4.3/ueditor.config.js}"></script>
<script type="text/javascript" src="lib/ueditor/1.4.3/ueditor.all.min.js"  th:src="@{/lib/ueditor/1.4.3/ueditor.all.min.js}"> </script>
<script type="text/javascript" src="lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js" th:src="@{/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js}"></script>
<script type="text/javascript">
$(function(){

    $(".form_datetime").datetimepicker({format: 'yyyy-mm-dd hh:ii:ss'});
    /**
	 * 判断是否编辑，加载数据
     */
    if($('#id').val()!='' && $('#id').val()!=null){
        //alert($('#id').val());
        setInti($('#id').val());
	}else{
        $('#considerAdmissionTime').html(intiSelectYear());
	}

    $('#infoManageSave').on('click', function() {


		if(!checkParam()){
		    return false;
		}
        var body = $('form').serializeObject();
        var id = body.id;
        var data={"head": window.parent.parent.indexParam.getHead(),"data":body};
        data = null2str(data);//转换数据
        var postUrl = "";
        if(id!=null && id!=''){
            postUrl=window.parent.parent.indexParam.getUrl('updateInfoManage');
            //data.data.id=id;
		}else{
            postUrl= postUrl=window.parent.parent.indexParam.getUrl('addInfo');
		}
        $.ajax({
            url:postUrl,
            type:"POST",
            data:JSON.stringify(data),
            contentType:"application/json",  //缺失会出现URL编码，无法转成json对象
            success:function(result){
                console.log(result);
                if(result.head.respStatus=="00"){
                    alert(result.head.respDesc);
				}else{
					alert(result.head.respDesc);
				}
            }
        });
    });
});


function setStateName(name,val) {
    //alert(map[val]);
    $("#stateName").val(map[val]);
    $("#infoState").val(val);
}

//编辑初始化数据
function setInti(id) {
    var body={'id':id};
    var data={"head": window.parent.parent.indexParam.getHead(),"data":body};
    $.ajax({
        url:window.parent.parent.indexParam.getUrl('getInfoManage'),
        type:"POST",
        data:JSON.stringify(data),
        contentType:"application/json",  //缺失会出现URL编码，无法转成json对象
        success:function(result){
            console.log(result);
            if(result.head.respStatus=="00"){
                //alert(result.head.respDesc);
				$('#appointment').val(result.data.appointment);
				$('#callTime').val(result.data.callTime);

				$('#consultationContent').val(result.data.consultationContent);
				$('#contactNumMain').val(result.data.contactNumMain);
				$('#contactNumOther').val(result.data.contactNumOther);
				$('#currentGrade').val(result.data.currentGrade);
				$('#currentSchool').val(result.data.currentSchool);
				$('#effective').val(result.data.effective);
                $('#extra_data').val(result.data.extra_data);
                $('#homeAddress').val(result.data.homeAddress);
                $('#infoSource').val(result.data.infoSource);
                $('#englishScore').val(result.data.englishScore);
                $('#mathScore').val(result.data.mathScore);
                $('#phyChemScore').val(result.data.phyChemScore);
                $('#remark').val(result.data.remark);
                $('#studentName').val(result.data.studentName);
                $('#remark').val(result.data.remark);
                $('#parentNameMain').val(result.data.parentNameMain);
                $('#parentNameOther').val(result.data.parentNameOther);
                if(result.data.infoState!=null && result.data.infoState!=''){
                    $('#stateName').val(map[result.data.infoState]);
				}
				if(result.data.considerAdmissionTime!=null && result.data.considerAdmissionTime!=''){
                    $('#considerAdmissionTime').html(intiSelectYear(result.data.considerAdmissionTime));
				}else{
                    $('#considerAdmissionTime').html(intiSelectYear());
				}


            }else{
                alert(result.head.respDesc);
            }
        }
    });
}

function getYearArr() {
    var yearArr = [];
    var mydate = new Date();
    var yearStr = mydate.getFullYear()+''; //获取完整的年份(4位,1970-????)
	for(var i=0;i<5;i++){
        var year = parseInt(yearStr)+i;
        yearArr.push(year+'年春季');
        yearArr.push(year+'年秋季');
	}
	return yearArr;
}

function intiSelectYear(selectVal) {
    var yearArr = getYearArr();
    var selectHtml ='<option value=""></option>';
    if(selectVal!=null&&selectVal!=''){
        selectHtml+='<option value="'+selectVal+'" selected>'+selectVal+'</option>';
    }
	$(yearArr).each(function (i,item) {
        selectHtml+='<option value="'+item+'">'+item+'</option>';
    });
	return selectHtml;
}

function checkParam() {
	if($('#callTime').val()==null || $('#callTime').val()==''){
	    alert('来电日期时间 不能为空！');
	    return false;
	}

    if($('#studentName').val()==null || $('#studentName').val()==''){
        alert('学生姓名 不能为空！');
        return false;
    }

    if($('#consultationContent').val()==null || $('#consultationContent').val()==''){
        alert('咨询内容 不能为空！');
        return false;
    }

    if($('#infoSource').val()==null || $('#infoSource').val()==''){
        alert('信息来源 不能为空！');
        return false;
    }
	return true;
}
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>